﻿using System.Diagnostics;
using System.IO;
using UnityEditor;
using UnityEngine;

public partial class LitMenu
{

    /// <summary>
    /// 打开持久化文件路径
    /// </summary>
    [MenuItem("LitMenu/Presistent/OpenFolder")]
    private static void OpenPresistentFile()
    {
        Process.Start(new ProcessStartInfo() { FileName = Application.persistentDataPath });
    }

    /// <summary>
    /// 删除持久化文件
    /// </summary>
    [MenuItem("LitMenu/Presistent/Clear")]
    public static void DeleteAllFile()
    {
        if (Directory.Exists(Application.persistentDataPath))
        {
            Directory.Delete(Application.persistentDataPath, true);
            UnityEngine.Debug.Log($"[PresistentFileUtility] DeleteAllFile file");
        }
        else
        {
            UnityEngine.Debug.LogWarning($"[PresistentFileUtility] DeleteAllFile file not exist");
        }
    }
}
